﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using log4net;

namespace RouterControl.Db
{
	internal sealed class SqlLogTextWriter : TextWriter
	{
		private readonly ILog _log = LogManager.GetLogger(typeof(SqlLogTextWriter));

		public override Encoding Encoding
		{
			get { return Encoding.Default; }
		}

		public override void Write(char[] buffer, int index, int count)
		{
			if (_log.IsDebugEnabled)
				_log.Debug(new string(buffer, index, count));
		}

	}
}
